package com.knowledge.plus.自定义注解.example2;

import com.knowledge.plus.自定义注解.example2.annotation.LoginRequired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author PF.Tian
 * @since 2021/09/13
 */
@RestController
public class LoginDemoController {


    @GetMapping("/sourceA")
    public String sourceA() {
        return "你正在访问sourceA资源";
    }

    /**
     * 在sourceB方法上添加我们的登录注解@LoginRequired
     */
    @LoginRequired
    @GetMapping("/sourceB")
    public String sourceB() {
        return "你正在访问sourceB资源";
    }

}
